﻿<Window x:Class="DotBeer.UI.WPFClient.WindowAddNewObject"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="307" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    ResizeMode="NoResize" 
    Height="119" 
    Background="{DynamicResource BrushWindowBackground}" 
    Closing="Window_Closing" 
    WindowStartupLocation="CenterScreen" 
    TabIndex="0" 
    Icon="/PresentationLayer;component/Images/icon.ico"
    xmlns:PresentationLayer="clr-namespace:DotBeer.UI.WPFClient"
        >
	<Window.Resources>
        <PresentationLayer:ReverseBoolConverter x:Key="reverseBoolConverter"/>
	</Window.Resources>
    <Grid>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="40"/>
    		<ColumnDefinition Width="*"/>
    	</Grid.ColumnDefinitions>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="40"/>
    		<RowDefinition Height="40"/>
    	</Grid.RowDefinitions>
    	<TextBlock Text="Name:" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0"/>
    	<!--<TextBox x:Name="TextBoxName" HorizontalAlignment="Stretch" VerticalAlignment="Center" TextWrapping="Wrap" Grid.Column="1" Margin="5,0,5,0" Template="{DynamicResource TextBoxControlTemplate}" TabIndex="0" />-->
        <TextBox x:Name="TextBoxName" HorizontalAlignment="Stretch" VerticalAlignment="Center" TextWrapping="Wrap" Grid.Column="1" Margin="5,0,5,0" Template="{DynamicResource TextBoxControlTemplate}" TabIndex="0">
            <Binding Path="NewObjectName" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True">
                <Binding.ValidationRules>
                    <PresentationLayer:NameValidation></PresentationLayer:NameValidation>
                </Binding.ValidationRules>
            </Binding>
        </TextBox>
        <Button x:Name="ButtonAdd" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Content="Add" Grid.Row="1" Grid.Column="1" Margin="5,0,5,5" Style="{DynamicResource ButtonLightStyle}" Height="30" Click="ButtonAdd_Click" IsDefault="True"/> <!--IsEnabled="{Binding Path=(Validation.HasError), Converter={StaticResource reverseBoolConverter}, ElementName=TextBoxName, Mode=OneWay}"/>-->
    </Grid>
</Window>
